﻿using System;
using System.Collections.Generic;
namespace TEST02
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> listA = new List<int>();
            List<int> listB = new List<int>();
            List<int> list = new List<int>(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i] % 2 != 0)
                {
                    listA.Add(list[i]);
                }
                else
                {
                    listB.Add(list[i]);
                }
            }
            Console.Write("奇数：");
            foreach (int item in listA)
            {
                Console.Write(item+" ");
            }
            Console.WriteLine();
            Console.Write("偶数：");
            foreach (int item in listB)
            {
                Console.Write(item+" ");
            }
        }
    }
}
